import java.util.Scanner;

public class Test {

    //字母大小写转换

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()){
            String s = scanner.nextLine();
            char ch = s.charAt(0);
            if(ch >= 'A' && ch <= 'Z'){
                ch = (char)(ch + 32);
            }else if(ch >= 'a' && ch <= 'z'){
                ch = (char)(ch - 32);
            }

            System.out.println(ch);
        }
    }
}
